package com.xidian.zhiancloud.util.zyf;

import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @Author: Summerless
 * @Date: 2021/3/1 16:49
 */
@Component
public class StringUtils {
    public static String concatStrings(List<String> stringList) {
        StringBuffer buffer = new StringBuffer();
        Boolean first = true;
        for (String s : stringList) {
            if (first) {
                buffer.append(s);
                first = false;
            } else {
                buffer.append(",");
                buffer.append(s);
            }
        }
        return buffer.toString();
    }

    public static String concatLongs(List<Long> longs) {
        StringBuffer buffer = new StringBuffer();
        Boolean first = true;
        for (Long aLong : longs) {
            if (first) {
                buffer.append(aLong.toString());
                first = false;
            } else {
                buffer.append(",");
                buffer.append(aLong.toString());
            }
        }
        return buffer.toString();
    }
}
